﻿using System;
using FFIV.Lib.Controlers.Admin;
using FFIV.Lib.Utilities;
using FFIV.Lib.WebExtension;

public partial class Admin_ManageCategories : FFWebPageBase
{
	private ManageCategoriesController m_Controller;

	protected override void InitialFileds()
	{
		m_Controller = new ManageCategoriesController(uc_ManageCategories);
	}

	protected override void BindingEvents()
	{
		uc_ManageCategories.AddCategory += uc_ManageCategories_AddCategory;
		uc_ManageCategories.AddChildCategory += uc_ManageCategories_AddChildCategory;
		uc_ManageCategories.EditCategory += uc_ManageCategories_EditCategory;
		uc_ManageCategories.DeleteCateory += uc_ManageCategories_DeleteCateory;
	}

	public override void ShowMessage()
	{
		if (!IsPostBack)
		{
			m_Controller.LoadPage();
		}
	}

	public override Permissions RequiredPermission
	{
		get { return Permissions.Admin; }
	}

	private void uc_ManageCategories_AddCategory(object sender, EventArgs e)
	{
		m_Controller.AddCategory();
	}

	private void uc_ManageCategories_AddChildCategory(object sender, EventArgs e)
	{
		m_Controller.AddChildCategory();
	}

	private void uc_ManageCategories_EditCategory(object sender, EventArgs e)
	{
		m_Controller.EditCategory();
	}

	private void uc_ManageCategories_DeleteCateory(object sender, EventArgs e)
	{
		m_Controller.DeleteCategory();
	}

}
